package com.siyao.redvip.utils;

import java.util.HashMap;
import java.util.Map;
import android.content.Context;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;

public class VolleyUtils {

	private void getJsonPost(Context context) {  
        RequestQueue requestQueue = Volley.newRequestQueue( context);  
        String url = "http://127.0.0.1:8099/api/api.ashx";  
        StringRequest postRequest = new StringRequest(Request.Method.POST, url,  
                new Response.Listener<String>() {  
                    @Override  
                    public void onResponse(String response) {  
                        //处理返回的JSON数据  
//                        Log.d("Response", response);  
                    }  
                }, new Response.ErrorListener() {  
                    @Override  
                    public void onErrorResponse(VolleyError error) {  
                    	
                    }  
                }) {  
            @Override  
            protected Map<String, String> getParams() {  
                //POST 参数  
                Map<String, String> params = new HashMap<String, String>();  
                params.put("action", "product_list");  
                params.put("ver", "1");  
                params.put("pageindex", "1");  
                params.put("pageCount", "5");  
                return params;  
            }  
        };  
        requestQueue.add(postRequest);  
    } 
    
}
